package com.zcf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zcf.common.json.Body;
import com.zcf.pojo.Game;
import com.zcf.service.GameService;
import com.zcf.vo.out.LayuiJson;

@CrossOrigin
@Controller
@RequestMapping("/game")
public class GameController {
	
	@Autowired
	GameService gameService;
	/**
	 * 牛牛后台获取游戏管理
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@PostMapping("getgame")
	@ResponseBody
	public LayuiJson getgame(@RequestParam(value = "pageNum")int pageNum, 
			 @RequestParam(value = "pageSize") int pageSize){
		return gameService.getgame(pageNum,pageSize);
	}
	/**
	 * 扎金花后台获取游戏管理
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@PostMapping("getZgame")
	@ResponseBody
	public LayuiJson getZgame(@RequestParam(value = "pageNum")int pageNum, 
			 @RequestParam(value = "pageSize") int pageSize){
		return gameService.getZgame(pageNum,pageSize);
	}
	/**
	 * 修改局数、消耗房卡数
	 * @param game
	 * @return
	 */
	@PostMapping("updategame")
	@ResponseBody
	public Body updategame(Game game){
		return gameService.updategame(game);
	}
	/**
	 * 牛牛获取房卡
	 */
	@PostMapping("getroomcard")
	@ResponseBody
	public Body getroomcard(Game game){
		return gameService.getroomcard(game);
	}
	/**
	 * 扎金花获取房卡
	 */
	@PostMapping("getZroomcard")
	@ResponseBody
	public Body getZroomcard(Game game){
		return gameService.getZroomcard(game);
	}


	
}
